<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //作用域
        var num1 = 55;
        var num2 = 66;

        function f1(num, num1) {
            num = 100;
            num1 = 166;
            num2 = 166;
            console.log(num);
            console.log(num1)
            console.log(num2);
        }
        fl(numl, num2);
        console.log(num1);
        console.log(num2);
        console.log(num);


        //值类型和引用类型的传递

        function Person(name, age, salary){
            this.name= name;
            this.age= age;
            this.salary= salary;
        }
        
        function f1(person) {
            person.name= "ls"; 
            person = new Person ("aa", 18, 10);
           
        }
            var p= new Person("zs", 18, 1000);
            console. log(p.name);
            f1(p);
            console. log(p.name);
    </script>
</body>

</html>